<?php
/**
 * Created by PhpStorm.
 * User: 10037
 * Date: 2022/6/13
 * Time: 19:16
 */

namespace app\admin\controller;


use app\admin\model\Backlinks;

class Links
{
    public function addLinks($linkName,$linkUrl,$linkImg){
        $link=new Backlinks();
        $result=$link->addLinks($linkName,$linkUrl,$linkImg);
        if($result){
            return json([
                'status'=>200
            ]);
        }

        return json([
            'status'=>400
        ]);
    }

    public function selectLinkAll(){
        $link=new Backlinks();
        return $link->selectLinkAll();
    }

    public function deleteLinks($id){
        $link=new Backlinks();
        $result= $link->deleteLink($id);
        if($result){
            return json([
                'status'=>200
            ]);
        }

        return json([
            'status'=>400
        ]);
    }
}